package uitest 
{
	import flash.display.Sprite;
	import flash.net.Socket;
	import flash.utils.setTimeout;
	import iscript.uiFramework.components.button.BaseButton;
	import iscript.uiFramework.components.button.ButtonGroup;
	import iscript.uiFramework.components.panel.TabPanel;
	import iscript.uiFramework.components.toolButton.MinButton;
	import iscript.uiFramework.components.UIComponent;
	
	public class ButtonUITest extends  Sprite
	{
		[Embed(source="../../bin/lufei.jpg")]
		private var lufei:Class;
		
		public var  b:BaseButton = new BaseButton()
		public function ButtonUITest() 
		{
			this.x = 100;
			this.y = 100;
			
			
			//b.toggle = true;
		
			//b.flat = true;
			b.render(this);				
			b.text = "Hello中文xxxxxxxxx";
			b.ClickHandler = clickButton
			//b.setPressed();
			//b.setReleased();
			
			
			setTimeout(function():void {
				  UIComponent(b).width= 500
				},2000)
			
			
			var butGroup:ButtonGroup = new ButtonGroup();
			for (var i:int = 0; i < 5; i++) 
			{
				var but:BaseButton = new BaseButton()
				//but.theme ="GoogleTheme"
				//but.flat = true;
				but.width = 100;
				but.height = 100;
				but.y = 50;
				but.text = "Button-" + i;
				butGroup.append(but);
				but.x = but.width * i ;
				but.render(this)
			}
			
			var tab:TabPanel = new TabPanel(330,200);
			tab.y = 200
			
			for (var j:int = 0; j < 10; j++) 
			{
				
			tab.addTab("name-"+j); 
			}
			//tab.border = true;
			tab.render(this);
			
			tab.getBody(0).append(new lufei());
			tab.height= 400
			
			return;
			
			
			var min:MinButton = new MinButton();
			min.x= 300
			min.toggle = true;
			min.render(this)
			
			 
			
			
			
			
			
			
		}
		
		private function clickButton(e:BaseButton):void 
		{
			 trace(b.IsPressed, b.IsReleased);
			  // trace("click");
			//setTimeout(function():void{e.dispose()}, 3000);
		}
		
	}

}